import { createRouter, createWebHistory } from 'vue-router'
import SearchWord from '../views/SearchWord'
import Memorize from "../views/Memorize";
import Layout from "../layout/Layout";
import Login from "../views/Login"
import Analyze from "@/views/Analyze";
import Info from "@/views/Infomation";
import Setting from "@/views/Settting";
import Register from "@/views/Register";
import Remember from "@/views/Remember";
import Efficiency from "@/views/Efficiency";
import Book from "@/views/Book";
const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect:'/memorize',
    children:[
      {
        path: '/memorize',
        name: 'memorize',
        component: Memorize
      },
      {
        path: '/search',
        name: 'search',
        component: SearchWord
      },
      {
        path: '/analyze',
        name: 'analyze',
        component: Analyze
      },
      {
        path: '/info',
        name: 'info',
        component: Info
      },
      {
        path: '/setting',
        name: 'setting',
        component: Setting
      },
      {
        path: '/book',
        name: 'book',
        component: Book
      },
      {
        path: '/remember',
        name: 'remember',
        component: Remember
      },
      {
        path: '/efficiency',
        name: 'efficiency',
        component: Efficiency
      },
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component:Login
  },
  {
    path: '/register',
    name: 'register',
    component:Register
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
